package pe.edu.upc.dsd.jaxrs;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import pe.edu.upc.dsd.rest.Deal;

@Path("/deals")
@Produces("application/json")
@Consumes("text/plain,application/json")
public class DealService {

	@GET
	@Path("/listDeals")
	public Collection<Deal> getDeals() {
		List<Deal> lista = new ArrayList<Deal>();
		lista.add(new Deal("01","tele", "01/01/2012", "UPC Store", "1500"));
		return lista;
	}
	

	@GET
	@Path("/getDeal/{id}")
	public Deal getDeal(@PathParam("id") String id) {
		System.out.println("pido el deal id = " + id);
		return new Deal("01","tele", "01/01/2012", "UPC Store", "1500");
	}
	
	
}
